#Figure 4(a): Predicted Probabilities

library(foreign)
library(extrafont)
library(readstata13)
loadfonts()
data<-read.dta13("Preds_ObstrProbPredsFigure_Reshape.dta")
womanscale<-data[,1]
womanmean<-data[,2]
womanlb<-data[,3]
womanub<-data[,4]
manscale<-data[,7]
manmean<-data[,8]
manlb<-data[,9]
manub<-data[,10]
pdf(file="Figure4a.pdf", family="Bookman")
options(warn=-1)

plot(womanmean, womanscale, xlim=c(0,.08), ylim=c(0.5, 4.5), xlab="Predicted Probabilities of Language Supporting Obstruction", ylab="Party of Member", pch=16, col="gray70", tick=FALSE, labels=FALSE)

points(manmean, manscale, pch=17, col="black")

segments(manlb[1], 3, manub[1], 3, lwd=1.35, col="black")
segments(manlb[2], 1, manub[2], 1, lwd=1.35, col="black")

segments(womanlb[1], 4, womanub[1], 4, lwd=1.35, col="gray70")
segments(womanlb[2], 2, womanub[2], 2, lwd=1.35, col="gray70")

axis(2, at=3, labels="Republicans", tick=TRUE)
axis(2, at=4, labels="Republicans", tick=TRUE)
axis(2, at=1, labels="Democrats", tick=TRUE)
axis(2, at=2, labels="Democrats", tick=TRUE)

axis(1, at=0, labels=TRUE, tick=TRUE)
axis(1, at=.01, labels=FALSE, tick=TRUE)
axis(1, at=.02, labels=TRUE, tick=TRUE)
axis(1, at=.03, labels=FALSE, tick=TRUE)
axis(1, at=.04, labels=TRUE, tick=TRUE)
axis(1, at=.05, labels=FALSE, tick=TRUE)
axis(1, at=.06, labels=TRUE, tick=TRUE)
axis(1, at=.07, labels=FALSE, tick=TRUE)
axis(1, at=.08, labels=TRUE, tick=TRUE)
axis(1, at=.09, labels=FALSE, tick=TRUE)
axis(1, at=.1, labels=TRUE, tick=TRUE)

legend("topleft", c('Women', 'Men'), pch=c(16, 17), col=c("gray70", "black"))

dev.off()



#Figure 4(b): Marginal Effects

library(foreign)
library(extrafont)
library(readstata13)
loadfonts()
data<-read.dta13("Preds_ObstrProbMargEffsFigure.dta")
scale<-data[,1]
mean<-data[,2]
lb<-data[,3]
ub<-data[,4]
pdf(file="Figure4b.pdf", family="Bookman")
options(warn=-1)

plot(mean, scale, xlim=c(-.015,.025), ylim=c(0.5, 2.5), xlab="Marginal Effects of Gender on Likelihood of Language Supporting Obstruction", ylab="Party of Member", pch=16, col="black", tick=FALSE, labels=FALSE)

segments(lb[1], 2, ub[1], 2, lwd=1.35, col="black")
segments(lb[2], 1, ub[2], 1, lwd=1.35, col="black")

segments(0, 0, 0, 3, lty=2)

axis(2, at=2, labels="Republicans", tick=TRUE)
axis(2, at=1, labels="Democrats", tick=TRUE)

axis(1, at=-.03, labels=TRUE, tick=TRUE)
axis(1, at=-.02, labels=TRUE, tick=TRUE)
axis(1, at=-.015, labels=TRUE, tick=TRUE)
axis(1, at=-.01, labels=TRUE, tick=TRUE)
axis(1, at=-.005, labels=TRUE, tick=TRUE)
axis(1, at=0, labels=TRUE, tick=TRUE)
axis(1, at=.005, labels=TRUE, tick=TRUE)
axis(1, at=.01, labels=TRUE, tick=TRUE)
axis(1, at=.015, labels=TRUE, tick=TRUE)
axis(1, at=.02, labels=TRUE, tick=TRUE)
axis(1, at=.025, labels=TRUE, tick=TRUE)
axis(1, at=.03, labels=TRUE, tick=TRUE)

dev.off()